package com.baizhi.controller;

import com.baizhi.entity.Item;
import com.baizhi.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("item")
public class ItemController {
    @Autowired
    private ItemService itemService;

    @RequestMapping("selectItem")
    @ResponseBody
    public Map selectItem(Integer orderId){
        Map map = new HashMap();
        List<Item> items = itemService.selectItemByOrderId(orderId);
        map.put("list",items);
        return map;
    }
}
